import { createRouter, createWebHistory } from 'vue-router'
import LayoutView from '@/views/LayoutView.vue'
import HomeView from '../views/Homeview/HomeView.vue'
import Orderview from '@/views/Orderview/Orderview.vue' 
import Taskview from '@/views/Taskview/Taskview.vue'
import Mineview from '@/views/Mineview/Mineview.vue'  
import Loginview from '@/views/Loginview/Loginview.vue'
import Registerview from '@/views/Registerview/Registerview.vue'
import Personview from '@/views/Personview/Personview.vue'
import Addressview from '@/views/Addressview/Addressview.vue'
import PlaceOrderview from '@/views/PlaceOrderview/PlaceOrderview.vue'
import Personheadview from '@/views/Personheadview/Personheadview.vue'
import IndependentMsgview from '@/views/IndependentMsgview/IndependentMsgview.vue'
import Historyview from '@/views/Historyview/Historyview.vue'
import Feedbackview from '@/views/Feedbackview/Feedbackview.vue'


const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'Layout',
      component: LayoutView,
      children: [
        {
          path: '/',
          name: 'home',
          component: HomeView,
        },
        {
          path:'/order',
          name:'order',
          component:Orderview,
        },
        {
          path:'/task',
          name:'task',
          component:Taskview,
        },
        { 
          path:'/mine',
          name:'mine',
          component:Mineview, 
        },
        {
          path:'/placeorder',
          name:'placeorder',
          component:PlaceOrderview
        }
      ]
    },
    {
      path:'/login',
      name:'login',
      component:Loginview
    },
    {
      path:'/register',
      name:'register',
      component:Registerview
    },
    {
      path:'/personal',
      name:'personal',
      component:Personview
    },
    {
      path:'/address',
      name:'address',
      component:Addressview
    },
    {
      path:'/personhead',
      name:'personhead',
      component:Personheadview
    },
    {
      path:'/independent',
      name:'independent',
      component:IndependentMsgview
    },
    {
      path:'/history',
      name:'history',
      component:Historyview
    },
    {
      path: '/feedback',
      name: 'feedback',
      component: Feedbackview,
    }
  ],
})

export default router
